﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using LibRadiant.Main;

namespace LibRadiant.IO
{
    public delegate void MouseEvent(MouseEventArgs inArg);
    public delegate void KeyboardEvent(KeyEventArgs inArg);
    public class IOManager
    {
        #region Events
        public event MouseEvent MouseDown;
        public event MouseEvent MouseUp;
        public event MouseEvent MouseMove;
        public event KeyboardEvent KeyDown;
        public event KeyboardEvent KeyUp;

        public bool FireMouseDownEvent(Object sender, MouseEventArgs inArgs)
        {
            if (MouseDown == null)
                return false;

            MouseDown(inArgs);
            return true;
        }

        public bool FireMouseUpEvent(Object sender, MouseEventArgs inArgs)
        {
            if (MouseUp == null)
                return false;

            MouseUp(inArgs);
            return true;
        }

        public bool FireMouseMoveEvent(Object sender, MouseEventArgs inArgs)
        {
            if (MouseMove == null)
                return false;

            MouseMove(inArgs);
            return true;
        }

        public bool FireKeyDownEvent(Object sender, KeyEventArgs inArgs)
        {
            if (KeyDown == null)
                return false;

            KeyDown(inArgs);
            return true;
        }

        public bool FireKeyUpEvent(Object sender, KeyEventArgs inArgs)
        {
            if (KeyUp == null)
                return false;

            KeyUp(inArgs);
            return true;
        }

        #endregion

        D3D9Core mContext;

        public IOManager(D3D9Core inContext)
        {
            mContext = inContext;
        }

    }
}
